package com.wn.sddfp.sms.controller;

import com.wn.sddfp.sms.service.ISmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author yellow Docter
 * @date 2024-07-30
 * @desc 蜗牛创想：www.woniuxy.com
 */
@RestController
@RequestMapping("/sms")
public class SmsController {

    @Autowired
    private ISmsService iSmsService;

    /**
     *   1、自定义注解
     *   2、把注解用到方法上面
     *   3、aop 解析注解 进行统计 存储到redis中
     *   4、判断 redis的一段时间进行统计的次数 是否进行方法的调用
     * @param phone
     * @return
     */
    @GetMapping("/{phone}")
    public Map<String,Object> getCode(@PathVariable("phone")String phone){
        Map<String,Object> map = iSmsService.getCode(phone);
        return map;
    }

}
